
#pragma once

#include <cstdint>
#include <memory>
#include <string>

class TagDataInfo
{
public:
	TagDataInfo();
	virtual void PrintInfo();

protected:
	int tag_data_size{0};
};

class MetaDataInfo : public TagDataInfo
{
public:
	MetaDataInfo();
	void PrintInfo() override;
};

class VideoDataInfo : public TagDataInfo
{
public:
	VideoDataInfo();
	void PrintInfo() override;
};

class AudioDataInfo : public TagDataInfo
{
public:
	AudioDataInfo();
	void PrintInfo() override;
};

class FlvFormat;


class FlvTag
{
public:
	friend class FlvFormat;
	FlvTag();
private:
	int m_tag_size;
	std::shared_ptr<FlvTag> m_tag_data;
};

class FlvHeader
{
public:
	friend class FlvFormat;
	FlvHeader();
	void PrintInfo();
	void InitMediaType(uint8_t has_video, uint8_t & has_audio);
	void InitVersion(uint8_t version);
	void InitDataOffset(uint32_t data);
private:
	const uint8_t m_f_data{'F'};
	const uint8_t m_l_data{'L'};
	const uint8_t m_v_data{'V'};
	uint8_t m_version{1};
	uint8_t m_has_video;
	uint8_t m_has_audio;
	uint32_t m_data_offset{9};
};

class FlvFormat
{
public:
	FlvFormat();
	void InitMediaType(uint8_t has_video, uint8_t & has_audio);
private:
	FlvHeader m_header;
	FlvTag m_tag;
};




